package com.gancp.dao.user;

import com.gancp.dao.IBaseMapper;
import com.gancp.domain.Attend;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;
import java.util.Map;

@Repository("AttendMapper")
public interface AttendMapper extends IBaseMapper<Attend, Long> {

    List<Attend> selectByUserid(Long userid);

    /**
     * @Author gancp
     * @Date 时间被黑洞吸走了
     * @Descripition 查询某天
     **/
    Attend selectSignRecord(@Param("someday") Date someday, @Param("userid") Long userid);

    /**
     * @Author gancp
     * @Date 时间被黑洞吸走了
     * @Descripition 获取数据分页
     **/
    List<Attend> selectAttendListByPage(Map param) throws Exception;

    /**
     * @Author gancp
     * @Date 时间被黑洞吸走了
     * @Descripition 查询昨天的考勤数据
     **/
    List<Attend> selectYestarDayRecond() throws Exception;

    /**
     * @Author gancp
     * @Date 时间被黑洞吸走了
     * @Descripition 查询昨天未打卡的数据
     **/
    List<Long> selectYestarDayAbsence() throws Exception;

    void batchInsert(List<Attend> list) throws Exception;
}